home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / QD3DShader.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  8.5 KB  |  315 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        QD3DShader.h
  3.  
  4.      Contains:    QuickDraw 3D Shader / Color Routines                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.6
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QD3DSHADER__
  18. #define __QD3DSHADER__
  19.  
  20. #ifndef __QD3D__
  21.     #include <QD3D.h>
  22. #endif
  23.  
  24. #ifndef __MOVIES__
  25.     #include <Movies.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=power
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51. #if PRAGMA_ENUM_ALWAYSINT
  52.     #pragma enumsalwaysint on
  53. #elif PRAGMA_ENUM_OPTIONS
  54.     #pragma option enum=int
  55. #elif PRAGMA_ENUM_PACK
  56.     #if __option(pack_enums)
  57.         #define PRAGMA_ENUM_PACK__QD3DSHADER__
  58.     #endif
  59.     #pragma options(!pack_enums)
  60. #endif
  61.  
  62. /******************************************************************************
  63.  **                                                                             **
  64.  **                                RGB Color routines                             **
  65.  **                                                                             **
  66.  *****************************************************************************/
  67. EXTERN_API_C( TQ3ColorRGB *)
  68. Q3ColorRGB_Set                    (TQ3ColorRGB *            color,
  69.                                  float                     r,
  70.                                  float                     g,
  71.                                  float                     b);
  72.  
  73. EXTERN_API_C( TQ3ColorARGB *)
  74. Q3ColorARGB_Set                    (TQ3ColorARGB *            color,
  75.                                  float                     a,
  76.                                  float                     r,
  77.                                  float                     g,
  78.                                  float                     b);
  79.  
  80. EXTERN_API_C( TQ3ColorRGB *)
  81. Q3ColorRGB_Add                    (const TQ3ColorRGB *    c1,
  82.                                  const TQ3ColorRGB *    c2,
  83.                                  TQ3ColorRGB *            result);
  84.  
  85. EXTERN_API_C( TQ3ColorRGB *)
  86. Q3ColorRGB_Subtract                (const TQ3ColorRGB *    c1,
  87.                                  const TQ3ColorRGB *    c2,
  88.                                  TQ3ColorRGB *            result);
  89.  
  90. EXTERN_API_C( TQ3ColorRGB *)
  91. Q3ColorRGB_Scale                (const TQ3ColorRGB *    color,
  92.                                  float                     scale,
  93.                                  TQ3ColorRGB *            result);
  94.  
  95. EXTERN_API_C( TQ3ColorRGB *)
  96. Q3ColorRGB_Clamp                (const TQ3ColorRGB *    color,
  97.                                  TQ3ColorRGB *            result);
  98.  
  99. EXTERN_API_C( TQ3ColorRGB *)
  100. Q3ColorRGB_Lerp                    (const TQ3ColorRGB *    first,
  101.                                  const TQ3ColorRGB *    last,
  102.                                  float                     alpha,
  103.                                  TQ3ColorRGB *            result);
  104.  
  105. EXTERN_API_C( TQ3ColorRGB *)
  106. Q3ColorRGB_Accumulate            (const TQ3ColorRGB *    src,
  107.                                  TQ3ColorRGB *            result);
  108.  
  109. EXTERN_API_C( float *)
  110. Q3ColorRGB_Luminance            (const TQ3ColorRGB *    color,
  111.                                  float *                luminance);
  112.  
  113. /******************************************************************************
  114.  **                                                                             **
  115.  **                                Shader Types                                 **
  116.  **                                                                             **
  117.  *****************************************************************************/
  118.  
  119. enum TQ3ShaderUVBoundary {
  120.     kQ3ShaderUVBoundaryWrap        = 0,
  121.     kQ3ShaderUVBoundaryClamp    = 1
  122. };
  123. typedef enum TQ3ShaderUVBoundary TQ3ShaderUVBoundary;
  124.  
  125.  
  126. /******************************************************************************
  127.  **                                                                             **
  128.  **                                Shader Routines                                 **
  129.  **                                                                             **
  130.  *****************************************************************************/
  131. EXTERN_API_C( TQ3ObjectType )
  132. Q3Shader_GetType                (TQ3ShaderObject         shader);
  133.  
  134. EXTERN_API_C( TQ3Status )
  135. Q3Shader_Submit                    (TQ3ShaderObject         shader,
  136.                                  TQ3ViewObject             view);
  137.  
  138. EXTERN_API_C( TQ3Status )
  139. Q3Shader_SetUVTransform            (TQ3ShaderObject         shader,
  140.                                  const TQ3Matrix3x3 *    uvTransform);
  141.  
  142. EXTERN_API_C( TQ3Status )
  143. Q3Shader_GetUVTransform            (TQ3ShaderObject         shader,
  144.                                  TQ3Matrix3x3 *            uvTransform);
  145.  
  146. EXTERN_API_C( TQ3Status )
  147. Q3Shader_SetUBoundary            (TQ3ShaderObject         shader,
  148.                                  TQ3ShaderUVBoundary     uBoundary);
  149.  
  150. EXTERN_API_C( TQ3Status )
  151. Q3Shader_SetVBoundary            (TQ3ShaderObject         shader,
  152.                                  TQ3ShaderUVBoundary     vBoundary);
  153.  
  154. EXTERN_API_C( TQ3Status )
  155. Q3Shader_GetUBoundary            (TQ3ShaderObject         shader,
  156.                                  TQ3ShaderUVBoundary *    uBoundary);
  157.  
  158. EXTERN_API_C( TQ3Status )
  159. Q3Shader_GetVBoundary            (TQ3ShaderObject         shader,
  160.                                  TQ3ShaderUVBoundary *    vBoundary);
  161.  
  162.  
  163. /******************************************************************************
  164.  **                                                                             **
  165.  **                            Illumination Shader    Classes                         **
  166.  **                                                                             **
  167.  *****************************************************************************/
  168. EXTERN_API_C( TQ3ObjectType )
  169. Q3IlluminationShader_GetType    (TQ3ShaderObject         shader);
  170.  
  171. EXTERN_API_C( TQ3ShaderObject )
  172. Q3PhongIllumination_New            (void);
  173.  
  174. EXTERN_API_C( TQ3ShaderObject )
  175. Q3LambertIllumination_New        (void);
  176.  
  177. EXTERN_API_C( TQ3ShaderObject )
  178. Q3NULLIllumination_New            (void);
  179.  
  180.  
  181. /******************************************************************************
  182.  **                                                                             **
  183.  **                                 Surface Shader                                 **
  184.  **                                                                             **
  185.  *****************************************************************************/
  186. EXTERN_API_C( TQ3ObjectType )
  187. Q3SurfaceShader_GetType            (TQ3SurfaceShaderObject  shader);
  188.  
  189.  
  190. /******************************************************************************
  191.  **                                                                             **
  192.  **                                Texture Shader                                 **
  193.  **                                                                             **
  194.  *****************************************************************************/
  195. EXTERN_API_C( TQ3ShaderObject )
  196. Q3TextureShader_New                (TQ3TextureObject         texture);
  197.  
  198. EXTERN_API_C( TQ3Status )
  199. Q3TextureShader_GetTexture        (TQ3ShaderObject         shader,
  200.                                  TQ3TextureObject *        texture);
  201.  
  202. EXTERN_API_C( TQ3Status )
  203. Q3TextureShader_SetTexture        (TQ3ShaderObject         shader,
  204.                                  TQ3TextureObject         texture);
  205.  
  206.  
  207. /******************************************************************************
  208.  **                                                                             **
  209.  **                                Texture Objects                                 **
  210.  **                                                                             **
  211.  *****************************************************************************/
  212. EXTERN_API_C( TQ3ObjectType )
  213. Q3Texture_GetType                (TQ3TextureObject         texture);
  214.  
  215. EXTERN_API_C( TQ3Status )
  216. Q3Texture_GetWidth                (TQ3TextureObject         texture,
  217.                                  unsigned long *        width);
  218.  
  219. EXTERN_API_C( TQ3Status )
  220. Q3Texture_GetHeight                (TQ3TextureObject         texture,
  221.                                  unsigned long *        height);
  222.  
  223.  
  224. /******************************************************************************
  225.  **                                                                             **
  226.  **                                Pixmap Texture                                 **
  227.  **                                                                             **
  228.  *****************************************************************************/
  229. EXTERN_API_C( TQ3TextureObject )
  230. Q3PixmapTexture_New                (const TQ3StoragePixmap * pixmap);
  231.  
  232. EXTERN_API_C( TQ3Status )
  233. Q3PixmapTexture_GetPixmap        (TQ3TextureObject         texture,
  234.                                  TQ3StoragePixmap *        pixmap);
  235.  
  236. EXTERN_API_C( TQ3Status )
  237. Q3PixmapTexture_SetPixmap        (TQ3TextureObject         texture,
  238.                                  const TQ3StoragePixmap * pixmap);
  239.  
  240.  
  241. /******************************************************************************
  242.  **                                                                             **
  243.  **                                Mipmap Texture                                 **
  244.  **                                                                             **
  245.  *****************************************************************************/
  246. EXTERN_API_C( TQ3TextureObject )
  247. Q3MipmapTexture_New                (const TQ3Mipmap *        mipmap);
  248.  
  249. EXTERN_API_C( TQ3Status )
  250. Q3MipmapTexture_GetMipmap        (TQ3TextureObject         texture,
  251.                                  TQ3Mipmap *            mipmap);
  252.  
  253. EXTERN_API_C( TQ3Status )
  254. Q3MipmapTexture_SetMipmap        (TQ3TextureObject         texture,
  255.                                  const TQ3Mipmap *        mipmap);
  256.  
  257. /******************************************************************************
  258.  **                                                                             **
  259.  **                    Compressed Pixmap Texture                                 **
  260.  **                                                                             **
  261.  *****************************************************************************/
  262. EXTERN_API_C( TQ3TextureObject )
  263. Q3CompressedPixmapTexture_New    (const TQ3CompressedPixmap * compressedPixmap);
  264.  
  265. EXTERN_API_C( TQ3Status )
  266. Q3CompressedPixmapTexture_GetCompressedPixmap (TQ3TextureObject  texture,
  267.                                  TQ3CompressedPixmap *    compressedPixmap);
  268.  
  269. EXTERN_API_C( TQ3Status )
  270. Q3CompressedPixmapTexture_SetCompressedPixmap (TQ3TextureObject  texture,
  271.                                  const TQ3CompressedPixmap * compressedPixmap);
  272.  
  273. EXTERN_API_C( TQ3Status )
  274. Q3CompressedPixmapTexture_CompressImage (TQ3CompressedPixmap * compressedPixmap,
  275.                                  PixMapHandle             sourcePixMap,
  276.                                  CodecType                 codecType,
  277.                                  CodecComponent         codecComponent,
  278.                                  short                     codedDepth,
  279.                                  CodecQ                 codecQuality);
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287. #if PRAGMA_ENUM_ALWAYSINT
  288.     #pragma enumsalwaysint reset
  289. #elif PRAGMA_ENUM_OPTIONS
  290.     #pragma option enum=reset
  291. #elif defined(PRAGMA_ENUM_PACK__QD3DSHADER__)
  292.     #pragma options(pack_enums)
  293. #endif
  294.  
  295. #if PRAGMA_STRUCT_ALIGN
  296.     #pragma options align=reset
  297. #elif PRAGMA_STRUCT_PACKPUSH
  298.     #pragma pack(pop)
  299. #elif PRAGMA_STRUCT_PACK
  300.     #pragma pack()
  301. #endif
  302.  
  303. #ifdef PRAGMA_IMPORT_OFF
  304. #pragma import off
  305. #elif PRAGMA_IMPORT
  306. #pragma import reset
  307. #endif
  308.  
  309. #ifdef __cplusplus
  310. }
  311. #endif
  312.  
  313. #endif /* __QD3DSHADER__ */
  314.  
  315.